<template>
  <section v-loading="loading" class="cms-body">
    <div class="cms-list-header flex-between">
      <!-- 右操作 -->
      <div>
        <cms-input label="协议标题" v-model="params.htmlTitle"></cms-input>
        <cms-input label="协议标识" v-model="params.htmlCode"></cms-input>
        <el-button @click="goQuery()">查询</el-button>
      </div>
    </div>
    <!-- 数据表格显示区域 -->
    <el-table :data="tableData" stripe style="width: 100%" @selection-change="checkIds">
      <el-table-column prop="id" label="ID" width="200" align="center"></el-table-column>
      <el-table-column prop="htmlTitle" label="协议标题" align="center"></el-table-column>
      <el-table-column prop="htmlCode" label="协议标识"  align="center"></el-table-column>

      <el-table-column width="100" label="操作" align="center">
        <div slot-scope="scope">
          <cms-button type="edit" @click.native="routerLink('/html/update','update',scope.row.id)" v-perms="'/html/update'"></cms-button>
        </div>
      </el-table-column>
    </el-table>

    <!-- 表格底部 -->
    <div class="cms-list-footer">
      <div class="cms-left"></div>
      <!-- cms分页组件 -->
      <cms-pagination :total="total" @change="getPages"></cms-pagination>
    </div>

  </section>
</template>
<script>
  import listMixins from '@/mixins/list'

  export default {
    mixins: [listMixins],
    data() {
      return {
        params:{
          pageNo: 1,
          pageSize: 10,
          htmlTitle: '',
          htmlCode: ''
        }
      }
    },
    methods: {
      goQuery(){
        this.getTableData(this.params);
      }
    },
    created() {
      this.initTableData(this.$api.htmlPageList, this.params);
    }
  };
</script>
